package repository

import (
	"gitee.com/fierce_wolf/go-fox-edge-common/commLogger"
	"gitee.com/fierce_wolf/go-fox-edge-common/commUtil/periodTask"
)

type RepoLocalJarFileScanTask struct {
}

func (e *RepoLocalJarFileScanTask) TaskType() periodTask.TaskType {
	return periodTask.TaskOnce
}

func (e *RepoLocalJarFileScanTask) SchedulePeriod() int64 {
	return 1
}

func (e *RepoLocalJarFileScanTask) Execute() {
	// 同步本地仓库信息
	fileNameMap, err := LocalJarFileCompScanner.ScanRepoCompEntityByJarMethod()
	if err != nil {
		commLogger.Console.Error("repoLocalJarFileScanTask : " + err.Error())
	}

	LocalJarFileCompScanner.ScanRepoCompEntity(fileNameMap)
}
